package com.slz3.business.module.memberManagement.memShoppingCar.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.memberManagement.memShoppingCar.domain.MemShoppingCar;
import com.slz3.business.module.memberManagement.memShoppingCar.domain.MemShoppingCarCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class MemShoppingCarResController {

    static Mono<ServerResponse> add(ServerRequest req, MemShoppingCar memShoppingCar) {
        if (MemShoppingCarResUnsafeValid.add(req, memShoppingCar)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShoppingCarResAtomic.add_$MemShoppingCarUpdateLock(req, memShoppingCar);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, MemShoppingCarCondition memShoppingCarCondition) {
        if (MemShoppingCarResUnsafeValid.delete(req, memShoppingCarCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShoppingCarResAtomic.delete_$MemShoppingCarUpdateLock(req, memShoppingCarCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, MemShoppingCar memShoppingCar) {
        if (MemShoppingCarResUnsafeValid.modify(req, memShoppingCar)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShoppingCarResAtomic.modify_$MemShoppingCarUpdateLock(req, memShoppingCar);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (MemShoppingCarResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShoppingCarResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (MemShoppingCarResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShoppingCarResAtomic.info_$MemShoppingCarUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (MemShoppingCarResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShoppingCarResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, MemShoppingCarCondition memShoppingCarCondition) {
        //
        if (MemShoppingCarResUnsafeValid.auditSubmit(req, memShoppingCarCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShoppingCarResAtomic.auditSubmit_$MemShoppingCarUpdateLock(req, memShoppingCarCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, MemShoppingCarCondition memShoppingCarCondition) {
        if (MemShoppingCarResUnsafeValid.audit(req, memShoppingCarCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShoppingCarResAtomic.audit_$MemShoppingCarUpdateLock(req, memShoppingCarCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, MemShoppingCarCondition memShoppingCarCondition) {
        if (MemShoppingCarResUnsafeValid.auditReject(req, memShoppingCarCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShoppingCarResAtomic.auditReject_$MemShoppingCarUpdateLock(req, memShoppingCarCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, MemShoppingCarCondition memShoppingCarCondition) {
        if (MemShoppingCarResUnsafeValid.usingEnable(req, memShoppingCarCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShoppingCarResAtomic.usingEnable_$MemShoppingCarUpdateLock(req, memShoppingCarCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, MemShoppingCarCondition memShoppingCarCondition) {
        if (MemShoppingCarResUnsafeValid.usingDisable(req, memShoppingCarCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShoppingCarResAtomic.usingDisable_$MemShoppingCarUpdateLock(req, memShoppingCarCondition);
        }
    }

}
